package com.yiwyn.spirngwebvue.demos.api;

import com.yiwyn.spirngwebvue.demos.web.User;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/user")
public class UserApiController {


    @GetMapping("/get")
    public ResponseEntity<User> getUser() {
        User user = new User();
        user.setAge(17);
        user.setName("Yiwyn");
        return ResponseEntity.ok(user);
    }


}
